package edu.uw.tcss360.group6.gui.MainCards;

import javax.swing.*;
import java.awt.*;

/**
 * Created with IntelliJ IDEA.
 * Author: Mais Abdulwahab
 * Author: David Sharer
 * Date: 2/20/13
 * Time: 9:46 PM
 * To change this template use File | Settings | File Templates.
 */
@SuppressWarnings("serial")
public class SplashPanel extends MainCard {
	
    public SplashPanel() {
        super();
    
    }

    public void paintComponent(final Graphics the_graphics)
    {
      super.paintComponent(the_graphics);
      final Graphics2D g2d = (Graphics2D) the_graphics;  
      g2d.setColor(Color.BLACK);
      g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                           RenderingHints.VALUE_ANTIALIAS_ON);
      
      final Rectangle rectangle = getBounds();
      final int width = rectangle.width;
      final int height = rectangle.height;
      
      final Image    image = createImage(width, height);
      final Graphics g     = image.getGraphics();
      drawBackground(g);
      g.drawRect(0, 0, width - 1, height - 1);
      g2d.drawImage(image, 0, 0, width, height, null);   
    } 
    private void drawBackground(final Graphics the_g2d)
    {
      final Rectangle rectangle = getBounds();
      final int width = rectangle.width;
      final int height = rectangle.height;
      final ImageIcon icon = new ImageIcon("pic3.jpg");
      final Image image = icon.getImage();
      the_g2d.drawImage(image, 0, 0, width, height, null);
    }
}
